
export interface StateType {
	historyList: string[],
	attentionList: string[]
}

export interface Action {
	type: string,
	payload: any
}

const initState: StateType = {
	historyList: ['衣服', '裤子', '首饰'],
	attentionList: []
}

const reducer = (state = initState, action: Action) => {
	switch (action.type) {
		case 'CLEAR_HISTORY_LIST':
			return {
				...state,
				historyList: []
			}
		case 'SET_ATTENTION_LIST': 
			return {
				...state,
				attentionList: action.payload
			}
		default:
			return {
				...state
			}
	}
}

export default reducer